home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / GSOS / TN.GSOS.011 < prev    next >
Encoding:
Text File  |  1991-01-11  |  3.2 KB  |  73 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. GS/OS
  7. #11:    About EraseDisk and Format
  8.  
  9. Revised by:    Matt Deatherage                                  November 1990
  10. Written by:    Dave Lyons & Matt Deatherage                         July 1990
  11.  
  12. This Technical Note explains how an application can tell when a user chooses
  13. Cancel from an EraseDisk or Format dialog box and explains why thefile_sys_ID
  14. field is ignored in class-zero calls.
  15. Changes since July 1990:  Noted that System Software 5.0.3 fixes some of these
  16. anomalies.
  17. _____________________________________________________________________________
  18.  
  19.  
  20. Detecting a Canceled Erase or Format Dialog Box
  21.  
  22. GS/OS Reference says that EraseDisk and Format return with the carry flag set
  23. and A equal to zero when the user cancels the operation.  This is great, except
  24. that the calls actually return with the carry clear, making a Cancel hard to
  25. distinguish from a successful EraseDisk or Format operation.  This happens in
  26. System Software 5.0.2 and earlier; it works as documented in GS/OS Reference in
  27. System Software 5.0.3 and later.
  28.  
  29. If you must use 5.0.2 or earlier versions of the system software, this Note
  30. presents a safe way around the problem, which works with all versions of the
  31. System Software:
  32.  
  33.   1.  In the parameter block for class-one EraseDisk or Format, set the
  34.       fileSysID field to 0.  (See note below.)
  35.   2.  Make the call.
  36.   3.  If the error code is non-zero, there was an error.  Handle it.
  37.   4.  Otherwise, the error code is zero.  Check the fileSysID field in
  38.       the parameter block.  If it is still zero, the user chose to
  39.       cancel the operation.
  40.  
  41. Note that this method only works for class-one calls. For the class-zero
  42. ERASE_DISK and FORMAT calls, the file_sys_ID word is only an input parameter and
  43. always remains unchanged.
  44.  
  45.  
  46. About the Class-Zero file_sys_ID Parameter
  47.  
  48. Even though fileSysID is an input parameter for the class-zero calls ERASE_DISK
  49. and FORMAT, all versions of the system software ignore thesupplied value and
  50. always give the user a dialog for selecting a file system.  This means no
  51. functionality is lost by putting a zero there.
  52.  
  53. The reasons for this decision are historical.  Although the Apple IIgs ProDOS 16
  54. Reference indicates that the input parameter file_sys_ID would be used in future
  55. versions to choose destination file systems, ProDOS 16 always returned an error
  56. if the file system specified was not $0001 (ProDOS).
  57.  
  58. Since this effectively means no ERASE_DISK or FORMAT call can be made under
  59. ProDOS 16 with any file_Sys_ID other than $0001, the GS/OS team chose to ignore
  60. the parameter and always give users the choice when using class zero calls.
  61. Otherwise, no program that existed when GS/OS was released would ever allow
  62. users to choose interleaves or file systems (they would always format for
  63. ProDOS, file system $0001).  (Note that the class-one Format andEraseDisk calls
  64. have a new reqFileSysID parameter; if this field is present, the dialog box is
  65. bypassed.)
  66.  
  67.  
  68. Further Reference
  69. _____________________________________________________________________________
  70.   o  GS/OS Reference
  71.   o  Apple IIgs ProDOS 16 Reference
  72.  
  73.